gcc -o0 -m32 -g swap1.c -o swap1
gcc -o0 -m32 -g swap2.c -o swap2
objdump -S swap1 > swap1.s
objdump -S swap2 > swap2.s


# close random stack
sysctl -w kernel.randomize_va_space=0

# complish two programmes with two more arguments to shut down stack overflow check
gcc -o0 -m32 -g -fno-stack-protector -z execstack -no-pie -fno-pic bug.c -o bug

gcc -o0 -m32 -g -fno-stack-protector -z execstack -no-pie -fno-pic hack.c -o hack

# disassembling
objdump -S bug > bug.s
objdump -S hack > hack.s

# run hack 
echo "now run hack"
./hack
